<form method="POST" enctype="multipart/form-data" action="document_edit.php">
<input type="hidden" name="document[id_document]" value="{{ document.id_document }}"/>

<table class="formtable" width="650">
	<tr>
		<td class="label" width="200">Titre * </td>
		<td><input type="text" name="document[titre]" class="large" value="{{ document.titre|escape }}"/></td>
	</tr>
	<tr>
		<td class="label">Type de partage</td>
		<td>
			<select class="large" name="document[type_partage]">
				<option {{ form.optionval(0, document.type_partage) }}>Visible par tout le monde</option>
				<option {{ form.optionval(1, document.type_partage) }}>Uniquement visible pour les utilisateurs avancés</option>
			</select>
		</td>
	</tr>
	{% if document.id_document %}
	<tr>
		<td class="label">Fichier</td>
		<td><a href="document_get_file.php?id={{ document.id_document }}">{{ document.filename }}</a></td>
	</tr>
	<tr>
		<td class="label">Modifier le fichier</td>
		<td><input type="file" name="document" class="large"/></td>
	</tr>
	<tr>
		<td class="label"></td>
		<td><input type="dropbox-chooser" name="document[dropboxfile]" style="visibility: hidden;" data-link-type="direct"/></td>
	</tr>	
	{% else %}
	<tr>
		<td class="label">Fichier *</td>
		<td><input type="file" name="document" class="large"/></td>
	</tr>
	<tr>
		<td class="label"></td>
		<td><input type="dropbox-chooser" name="document[dropboxfile]" style="visibility: hidden;" data-link-type="direct"/></td>
	</tr>	
	{% endif %}
	<tr>
		<td class="label fortextarea">Description</td>
		<td><textarea name="document[description]" rows="5" class="large">{{ document.description|escape }}</textarea></td>
	</tr>
	<tr class="actions">
		<td colspan="2">
			<input type="submit" class="button" value="Enregistrer"/>
		</td>
	</tr>
</table>
</form>